<!-- src/components/AgentCard.vue -->
<template>
  <div class="agent-card" @click="selectAgent">
    <div class="agent-avatar" :style="{ backgroundColor: agent.bgColor }">
      <i class="agent-icon">{{ agent.icon }}</i>
    </div>
    <div class="agent-info">
      <h3 class="agent-name">{{ agent.name }}</h3>
      <p class="agent-description">{{ agent.description }}</p>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    agent: {
      type: Object,
      required: true
    }
  },
  methods: {
    selectAgent() {
      this.$emit('select', this.agent);
    }
  }
};
</script>

<style scoped>
.agent-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.agent-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
  font-style: normal; /* 添加这行 */
}

.agent-icon {
  font-size: 20px;
  font-style: normal; /* 添加这行 */
}

.agent-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.agent-name {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-description {
  margin: 0;
  font-size: 11px;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
}
</style>